#pragma once

#include "myExceptions.h"

using namespace std;

template<class T>

void changeLen1D(T*& a, const int oldLen, int const newLen)
{
    if(newLen < 0)
        throw illegalParameterValue("new length must be >= 0");

    T* temp = new T[newLen];
    int number = min(oldLen, newLen);
    copy(a, a + number, temp);
    delete [] a;
    a = temp;
}


